<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.a{
				height: 100px;
				width: 100px;
				padding: 20px;
				position: relative;
			}
			.one{
				position: absolute;
				height: 100%;
				border: 1px solid red;
			}
			.b{
				height: 100px;
				width: 100px;
				padding: 20px;
			}
			.two{
				height: 100%;
				border: 1px solid;
			}
		</style>
	</head>
	<body>
		<div class="a"><div class="one">等哈就的</div></div>
		<div class="b"><div class="two">等哈就的</div></div>
		
		<script type="text/javascript">
			console.log(document.querySelector(".one").offsetHeight);//142  100+20+20+2
			console.log(document.querySelector(".two").offsetHeight);//102   100+2
		</script>
	</body>
</html>
